<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>应用配置</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/hyqcss/public.css">
	<style type="text/css">
		body{
			background: #e9e9e9;
		}
		/*公共头部带搜索*/
		.public_container{
			margin: 20px;
			/*background: #fff;*/
		}
		.public_title_container{
			height: 54px;
			padding: 0 20px;
			font-size: 14px;
			display: flex;
			align-items: center;
			background: #f9f9f9;
			border-bottom: 1px solid #f0f0f0;
			justify-content: space-between;
		}
		.public_title_container a{
			color: #1E9FFF;
			cursor: pointer;
		}
		.public_mian_container{
			background: #fff;
			padding:32px 32px 20px 32px;
		}
		.public_content{
			margin-top: 20px;
		}
		.public_content:first-child{
			margin-top: 0;
		}
		.settingCompany_container{
			border: 1px solid #e8e8e8;
			height: 60px;
			width: 250px;
			display: flex;
			justify-content: center;
			align-items: center;
			padding:20px 0;
			cursor: pointer;
		}
		.settingCompany_container svg{
			width: 30px;
			height: 30px;
			color: #999;
		}
		.public_mianLinkCompany{
			margin-top: 10px;
		}
		.public_mian_container h4{
			color: red;
			font-size: 14px;
		}
		.public_domainName_container{
			display: flex;
			align-items: center;
			margin-bottom: 10px;
		}
		.public_domainName_container a{
			color: #1890FF;
			font-size: 14px;
		}
		.public_domainName_container h3{
			font-size: 14px;
			color: rgba(0,0,0,0.65);
		}
		.public_mian_container h5{
			color: #999;
			font-size: 12px;
		}
	</style>
</head>
<body>
	<ul class="public-header-nav">
	    <li><a href="/Addons/Moments/Admin/Moments/pyq.html">朋友圈</a></li>
	    <li><a  class="public-header-nav-active" href="/Addons/Moments/Admin/Moments/quick_reply_steps.html">应用配置</a></li>
	  </ul>
	<form class="layui-form">
	<!-- 顶部提示框 开始 -->
	<!--<div class="public_tipSetting_contaienr">
		<div class="public_tipSetting_content">
			<p>本功能需新建应用，如需在工具栏设置快捷回复，可以在素材中心复制工具栏URL，详细配置可参考教程。</p>
			<a href="https://support.qq.com/products/174823/faqs/69700" target="_blank">查看教程</a>
		</div>
	</div>-->
	<!-- 顶部提示框 结束 -->
	<div class="public_container">
		<!-- /*公共头部*/ -->
		<div class="public_content">
			<div class="public_title_container">
				<p>第一步：在企业微信后台创建应用（应用管理-应用-自建-创建应用）</p>
			</div>
			<div class="public_mian_container">
				
				<a href="https://work.weixin.qq.com/wework_admin/frame#apps" type="button" class="layui-btn layui-btn-normal public_mianLinkCompany" target="_blank">前往创建应用</a>
			</div>
		</div>
		<div class="public_content">
			<div class="public_title_container">
				<p>第二步：设置自建应用信息</p>
             
			</div>
			<div class="public_mian_container">
			<h4>小提醒：请注意检查不要有空格</h4>
				<div class="settingCompany_container" id="openSecret">
					{if $appConfig->square_logo_url}
					<img id="square_logo_url" src="{$appConfig->square_logo_url}" width="60px" height="60px"/>
					<span id="appName">{$appConfig->name}</span>
					{else}
					<svg viewBox="64 64 896 896" data-icon="plus" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"></path><path d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"></path></svg>
					{/if}
				</div>
			</div>
		</div>
		<div class="public_content">
			<div class="public_title_container">
				<p>第三步：配置工作台应用主页</p>
			
			</div>
			<div class="public_mian_container">
				<h4 onclick="copyToClip('{$appPage}')">点击复制应用主页</h4>
				
				<a href="https://work.weixin.qq.com/wework_admin/frame#apps" type="button" class="layui-btn layui-btn-normal public_mianLinkCompany" target="_blank">前往配置链接</a>
			</div>
		</div>
		<div class="public_content">
			<div class="public_title_container">
				<p>第四步：设置应用可信域名</p>
			</div>
			<div class="public_mian_container">
				<!-- 域名xxx.com改成咱们的域名 -->
				<div class="public_domainName_container">
					<h3>在应用设置页，将 <?= $_SERVER['SERVER_NAME'];?> 设置为可信域名</h3>		
				</div>
			</div>
		<!-- /*公共头部*/ end -->
		
	</div>
	</form>
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script type="text/javascript">
		layui.use('form', function(){
		  var form = layui.form;
		  	
		  //监听提交
		  form.on('submit(formDemo)', function(data){
		    layer.msg(JSON.stringify(data.field));
		    return false;
		  });
		  form.render('select');
		  
		});
		// 上传文件
		layui.use('upload', function(){
		  var upload = layui.upload;
		   
		  //执行实例
		  var uploadInst = upload.render({
		    elem: '#test1' //绑定元素
			,accept: 'file' //普通文件
			,exts: 'txt' //只允许上传
		    ,url: 'upload_txt.html' //上传接口
		    ,done: function(res){
		      layer.msg(res.msg, {
						  time: 500 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
						  $("#uploadTxt").html(res.data.fileName);
						});
		    }
		    ,error: function(){
		      //请求异常回调
		    }
		  });
		});
	</script>
	<script type="text/javascript">
		
		$('#openSecret').click(function(){
			layer.open({
			  type: 2,
			  title: '请输入配置信息',
			  shadeClose: true,
			  shade: 0.2,
			  area: ['500px', '300px'],
			  content: 'quick_reply_set.html'
			}); 
		})
	</script>
	<script type="text/javascript">
		function copyToClip(content, message) {
			var aux = document.createElement("input"); 
			aux.setAttribute("value", content); 
			document.body.appendChild(aux); 
			aux.select();
			document.execCommand("copy"); 
			document.body.removeChild(aux);
			if (message == null) {
				layer.msg("复制成功");
			} else{
				layer.msg(message);
			}
		}
	</script>
</body>
</html>